package milk.ui
{
	import com.crlui.control.TabItem;
	import com.crlui.control.UIComponent;
	import com.crlui.control.skins.IRadioButtonSkin;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.filters.ColorMatrixFilter;
	import flash.filters.GlowFilter;
	import flash.geom.Rectangle;
	import flash.text.TextField;
	
	public class TabItemSkin implements IRadioButtonSkin
	{
		
		public static var glayFilter:Array = [new ColorMatrixFilter([0.3086,0.6094,0.082,0,0,0.3086,0.6094,0.082,0,0,0.3086,0.6094,0.082,0,0,0,0,0,1,0])];
		public static var empty:Array=[];
		
		
		private var skin:MovieClip;
		private var tf:TextField;
		public function TabItemSkin(mc:MovieClip)
		{
			mc.gotoAndStop(1);
			skin=mc;
			tf=skin["labelTF"];
		}
		
		
		
		public function getBoxSize():Rectangle
		{
			return null;
		}
		
		public function set label(value:String):void
		{
			
			tf.text=value;
		}
		
		public function set selected(value:Boolean):void
		{
			if(value==false){
				skin.filters=glayFilter;
				
				tf.textColor=0x666666;
			}else{
				skin.filters=empty;
				
				tf.textColor=0xFFFFFF;
			}
		}
		
		public function set enabled(value:Boolean):void
		{
		}
		
		public function initialize(c:UIComponent):void
		{
			
			var p:DisplayObjectContainer=skin.parent;
			
			c.x=skin.x;
			c.y=skin.y;
			
			skin.x=skin.y=0;
			
			c.addChild(skin);
			p.addChild(c);
			
			selected=false;
		}
		
		public function destory():void
		{
		}
		
		public function updateSize():void
		{
		}
		
		public function invalidate():void
		{
		}
		
		public function render():void
		{
		}
	}
}